package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DzXiezilouMapper;
import com.ruoyi.system.domain.DzXiezilou;
import com.ruoyi.system.service.IDzXiezilouService;


import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.mapper.DzHuiyuanMapper;
import com.ruoyi.system.domain.DzHuiyuan;
import com.ruoyi.system.service.IDzHuiyuanService;

/**
 * 商铺写字楼Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-17
 */
@Service
public class DzXiezilouServiceImpl implements IDzXiezilouService 
{
    @Autowired
    private DzXiezilouMapper dzXiezilouMapper;

    @Autowired
    private ISysRoleService sysRoleService;

    @Autowired
    private IDzHuiyuanService dzHuiyuanService;

    /**
     * 查询商铺写字楼
     * 
     * @param spId 商铺写字楼主键
     * @return 商铺写字楼
     */
    @Override
    public DzXiezilou selectDzXiezilouBySpId(Long spId)
    {
        return dzXiezilouMapper.selectDzXiezilouBySpId(spId);
    }

    /**
     * 查询商铺写字楼列表
     * 
     * @param dzXiezilou 商铺写字楼
     * @return 商铺写字楼
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<DzXiezilou> selectDzXiezilouList(DzXiezilou dzXiezilou)
    {

        return dzXiezilouMapper.selectDzXiezilouList(dzXiezilou);
    }

    @Override
    public List<DzXiezilou> selectDzXiezilouListWeb(DzXiezilou dzXiezilou)
    {
        return dzXiezilouMapper.selectDzXiezilouList(dzXiezilou);
    }

    /**
     * 新增商铺写字楼
     * 
     * @param dzXiezilou 商铺写字楼
     * @return 结果
     */
    @Override
    public int insertDzXiezilou(DzXiezilou dzXiezilou)
    {
        dzXiezilou.setCreateTime(DateUtils.getNowDate());
        return dzXiezilouMapper.insertDzXiezilou(dzXiezilou);
    }

    /**
     * 修改商铺写字楼
     * 
     * @param dzXiezilou 商铺写字楼
     * @return 结果
     */
    @Override
    public int updateDzXiezilou(DzXiezilou dzXiezilou)
    {
        return dzXiezilouMapper.updateDzXiezilou(dzXiezilou);
    }

    /**
     * 批量删除商铺写字楼
     * 
     * @param spIds 需要删除的商铺写字楼主键
     * @return 结果
     */
    @Override
    public int deleteDzXiezilouBySpIds(Long[] spIds)
    {
        return dzXiezilouMapper.deleteDzXiezilouBySpIds(spIds);
    }

    /**
     * 删除商铺写字楼信息
     * 
     * @param spId 商铺写字楼主键
     * @return 结果
     */
    @Override
    public int deleteDzXiezilouBySpId(Long spId)
    {
        return dzXiezilouMapper.deleteDzXiezilouBySpId(spId);
    }
}
